﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Gifts.aspx.cs" Inherits="Comod_Gifts" %>

<%@ Register Src="../usercontrol/PageNavigator.ascx" TagName="PageNavigator" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>商品品牌管理</title>
    <link href="../css/adminCss.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
    function CheckAll(form) {
	    for (var i=0;i<form.elements.length;i++) {
		    var e = form.elements[i];
		    if (e.name != 'chkall' && e.type=='checkbox')
			    e.checked = form.chkall.checked;
	    }
    }
    function PrintData(id)
    {
        if(id!="")
        {
  
            window.open("DrawPrint1.aspx?id="+id,"","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
        }
        return false;
    }
    </script>

</head>
<body style="text-align: center">
    <form id="form1" runat="server">
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="2%" height="1%">
                    <img src="../images/module.gif" width="20" height="22"></td>
                <td style="width: 310px; text-align: left;">
                    &nbsp;<asp:Label ID="lblPath" runat="server"></asp:Label></td>
                <td width="990" align="right">
                    <img src="../images/search.gif" alt="搜索" width="16" height="16" />
                    商品名称：<asp:TextBox ID="txtselecName" runat="server" CssClass="input1" Width="100px"></asp:TextBox>&nbsp;
                    <asp:Button ID="btnSelec" runat="server" Text="搜索" CssClass="submit" CausesValidation="False"
                        OnClick="btnSelec_Click" /></td>
            </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td bgcolor="#3CB6E5" height="5px">
                </td>
            </tr>
        </table>
        <asp:GridView ID="GvData" runat="server" CssClass="gridview" Width="99%" AutoGenerateColumns="False"
            RowStyle-HorizontalAlign="center" EmptyDataText="没有数据">
            <Columns>
                <asp:BoundField DataField="giftsId" HeaderText="ID号" />
                <asp:BoundField DataField="GiftsName" HeaderText="商品名称" />
                <asp:BoundField DataField="Num" HeaderText="库存数量" />
                <asp:TemplateField HeaderText="单价(元)">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Price","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:BoundField DataField="EditName" HeaderText="入库人" />
                <asp:BoundField DataField="Content" HeaderText="描述" />
                <asp:TemplateField HeaderText="是否赠送">
                    <ItemTemplate>
                        <asp:CheckBox ID="ckFlag" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <asp:LinkButton ID="linkbtn" runat="server" CommandArgument='<%#Eval("giftsId") %>'
                            OnClick="linkbtn_Click">添加商品</asp:LinkButton>
                        <asp:LinkButton ID="linkbtnEdit" runat="server" CommandArgument='<%#Eval("giftsId") %>' OnClick="linkbtnEdit_Click">修改</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle HorizontalAlign="Center" />
            <EmptyDataRowStyle ForeColor="Red" HorizontalAlign="Center" />
        </asp:GridView>
        <table width="99%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="width: 100px">
                </td>
                <td align="right">
                    <uc1:PageNavigator ID="PageNavigator1" runat="server" DataId="GvData" ConnectionString="connstr"
                        ShowType="Text" PageSize="15" />
                </td>
                <td height="5" align="right">
                    <input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="on" /><font
                        color="#FF0000"></font>全选&nbsp;
                    <asp:Button ID="btnAdd" runat="server" Text="添加" CssClass="submit" OnClick="btnAdd_Click" />&nbsp;<asp:Button
                        ID="Button1" runat="server" Text="删除" CssClass="submit" OnClientClick="return confirm('确定要审核吗?')"  OnClick="Button1_Click" />&nbsp;
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
